<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>宽度自适应</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        div{
            width: auto;
            /* 不写或者auto就是自适应 */
            height: 100px;
            padding-left: 100px;
            background: yellow;
        }
        /*
        应用于导航栏
        通栏布局
         */
    </style>
</head>
<body>
    <div></div>
</body>
</html>